package com.zsx.demo;

import java.util.Scanner;

/**
 * 〈4〉
 *
 * @author zhangsixian
 * @create 2021/6/11
 * @since 1.0.0
 */
public class Test5 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String aa = s.nextLine();
        String a = s.next();
        int num = 0;
        String[] split = aa.split("");
        for (String s1 : split) {
            if (s1.equalsIgnoreCase(a)){
                num = num + 1;
            }
        }
        System.out.println(num);
    }
}
